<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
class User_model extends CI_Model {
	public function __construct() {
		parent::__construct ();
	}
	/*
	 * 返回所有回扣用户
	 */
	public function find_kickback_users(){
		$this->db->where('kickback=1');
		$query=$this->db->get('t_user');
		return $query->result_array();
	}
	/*
	 * 返回所有特价用户
	 */
	public function find_special_users(){
		$this->db->where('kickback=2');
		$query=$this->db->get('t_user');
		return $query->result_array();
	}
	/*
	 * 根据用户ID得到用户信息
	 */
	public function load($id){
		$query = $this->db->get_where('t_user',array('id' => $id));
		if ($row = $query->row_array()){
			return $row;
		}
		return array();
	}
}